/**
 * 提现页面
 * author wim
 */
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_aygsh/base/Constant.dart';

class DrawMoneyPage extends StatefulWidget {
  DrawMoneyPage({Key key}) : super(key: key);

  @override
  _DrawMoneyPageState createState() => _DrawMoneyPageState();
}

class _DrawMoneyPageState extends State<DrawMoneyPage> {
  String pay_way = "alipay";
  @override
  void initState() {
    // TODO: implement initState
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: AppBar(
        title: Text(
          '余额提现',
          style: TextStyle(
              color: black,
              fontSize: ScreenUtil.getInstance().setSp(BIG_FONT_SIZE)),
        ),
        backgroundColor: white,
        brightness: Brightness.light,
        elevation: 0.2,
        iconTheme: IconThemeData(color: black_99),
      ),
      body: Container(
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: <Widget>[
            Container(
              width: double.infinity,
              decoration: BoxDecoration(
                  color: white, borderRadius: BorderRadius.circular(15)),
              padding:
                  EdgeInsets.all(ScreenUtil.getInstance().setHeight(DP_20)),
              margin: EdgeInsets.all(
                ScreenUtil.getInstance().setHeight(DP_20),
              ),
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: <Widget>[
                  Text('输入提现金额',
                      style: TextStyle(
                          color: black,
                          fontSize:
                              ScreenUtil.getInstance().setSp(SMALL_FONT_SIZE))),
                  Row(
                    children: <Widget>[
                      Text(MONEY,
                          style: TextStyle(
                              color: black,
                              fontSize: ScreenUtil.getInstance()
                                  .setSp(BIG_FONT_SIZE * 2 - 15))),
                      Expanded(
                        child: TextField(
                          style: TextStyle(
                              fontSize: ScreenUtil.getInstance()
                                  .setSp(BIG_FONT_SIZE * 2 - 15),
                              color: black),
                          keyboardType: TextInputType.numberWithOptions(),
                          maxLines: 1,
                          minLines: 1,
                          cursorColor: mainColor,
                          onChanged: (value) {
                            // old_code = value;
                          },
                          keyboardAppearance: Brightness.light,
                          decoration: new InputDecoration(
                            contentPadding: EdgeInsets.all(5),
                            hintText: "0.00",
                            border: InputBorder.none,
                            hintStyle: TextStyle(
                                fontSize: ScreenUtil.getInstance()
                                    .setSp(BIG_FONT_SIZE * 2),
                                color: black_99),
                          ),
                        ),
                      ),
                       Text("全部提现",
                          style: TextStyle(
                              color: Colors.blue,
                              fontSize: ScreenUtil.getInstance()
                                  .setSp(SMALL_FONT_SIZE))),
                    ],
                  ),
                  Divider(
                    height: 1.0,
                    indent: 0.0,
                    color: grey,
                  ),
                  Container(
                    height: 10,
                  ),
                  Row(
                    children: <Widget>[
                      Text('本次最多可提现  ',
                          style: TextStyle(
                              color: black,
                              fontSize: ScreenUtil.getInstance()
                                  .setSp(SMALL_FONT_SIZE))),
                      Text('34.56',
                          style: TextStyle(
                              color: mainColor,
                              fontSize: ScreenUtil.getInstance()
                                  .setSp(NORMAL_FONT_SIZE))),
                    ],
                  )
                ],
              ),
            ),
            Padding(
              padding:
                  EdgeInsets.all(ScreenUtil.getInstance().setHeight(DP_30)),
              child: Text('余额提现至',
                  style: TextStyle(
                      color: black,
                      fontSize: ScreenUtil.getInstance().setSp(BIG_FONT_SIZE))),
            ),
            Container(
              width: double.infinity,
              padding:
                  EdgeInsets.all(ScreenUtil.getInstance().setHeight(DP_20)),
              margin: EdgeInsets.fromLTRB(
                  ScreenUtil.getInstance().setHeight(DP_20),
                  0,
                  ScreenUtil.getInstance().setHeight(DP_20),
                  ScreenUtil.getInstance().setHeight(DP_20)),
              decoration: BoxDecoration(
                  color: white, borderRadius: BorderRadius.circular(15)),
              child: Column(
                children: <Widget>[
                  Row(
                    children: <Widget>[
                      Image.asset(
                        "images/icon_ipay.png",
                        scale: 1.1,
                      ),
                      Container(
                        width: 10,
                      ),
                      Expanded(
                        child: Text('支付宝',
                            style: TextStyle(
                                color: black,
                                fontSize: ScreenUtil.getInstance()
                                    .setSp(NORMAL_FONT_SIZE))),
                      ),
                      Checkbox(
                          value: pay_way == "alipay",
                          activeColor: mainColor,
                          checkColor: black_99,
                          materialTapTargetSize: MaterialTapTargetSize.padded,
                          onChanged: (bool x) {
                            if (pay_way == "wechat") {
                              pay_way = "alipay";
                            }
                            setState(() {});
                          }),
                    ],
                  ),
                  Container(
                    height: 5,
                  ),
                  Divider(
                    height: 1.0,
                    indent: 0.0,
                    color: grey,
                  ),
                  Container(
                    height: 5,
                  ),
                  // Row(
                  //   children: <Widget>[
                  //     Image.asset(
                  //       "images/icon_wechat.png",
                  //       scale: 1.1,
                  //     ),
                  //     Container(
                  //       width: 10,
                  //     ),
                  //     Expanded(
                  //       child: Text('微信',
                  //           style: TextStyle(
                  //               color: black,
                  //               fontSize: ScreenUtil.getInstance()
                  //                   .setSp(NORMAL_FONT_SIZE))),
                  //     ),
                  //     CircularCheckBox(
                  //         value: pay_way == "wechat",
                  //         activeColor: mainColor,
                  //         inactiveColor: black_99,
                  //         materialTapTargetSize: MaterialTapTargetSize.padded,
                  //         onChanged: (bool x) {
                  //           if (pay_way == "alipay") {
                  //             pay_way = "wechat";
                  //           }
                  //           setState(() {});
                  //         }),
                  //   ],
                  // ),
                ],
              ),
            ),
            new Container(
              width: double.infinity,
              margin: EdgeInsets.all(ScreenUtil.getInstance().setHeight(DP_40)),
              height: ScreenUtil.getInstance().setWidth(DP_90),
              decoration: new BoxDecoration(
                  color: Color.fromARGB(255, 255, 140, 16),
                  borderRadius: BorderRadius.circular(DP_80)),
              padding: EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 0.0),
              child: new FlatButton(
                child: new Padding(
                  padding: EdgeInsets.all(0.0),
                  child: new Text(
                    "提交申请",
                    style: new TextStyle(
                        color: Colors.white,
                        fontSize:
                            ScreenUtil.getInstance().setSp(NORMAL_FONT_SIZE)),
                  ),
                ),
                onPressed: () {
                  // _checkSub(context);
                  tixian();
                },
              ),
            )
          ],
        ),
      ),
    );
  }

  tixian()async{
    
  }
}
